<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('购货退货列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>退货单号：</label>
                                <input type="text" name="tuihuoDanhao"/>
                            </li>
                            <li>
                                <label>退货日期：</label>
                                <input type="text" class="time-input" placeholder="请选择退货日期" name="chukuDate"/>
                            </li>
                            <li>
                                <label>操作人：</label>
                                <input type="text" name="chukuMen"/>
                            </li>
                            <li>
                                <label>商品名称：</label>
                                <input type="text" name="shangpinName"/>
                            </li>
                            <li>
                                <label>商品类别：</label>
                                <select name="shangpinLeibie"  class="form-control">
                                    <option value="">所有</option>
                                    <option value="整套门">整套门</option>
                                    <option value="双开门左扇">双开门左扇</option>
                                    <option value="双开门右扇">双开门右扇</option>
                                    <option value="门扇">门扇</option>
                                    <option value="门框">门框</option>
                                    <option value="五金（防火锁）">五金（防火锁）</option>
                                    <option value="五金（闭门器）">五金（闭门器）</option>
                                    <option value="五金（拉爆盖）">五金（拉爆盖）</option>
                                </select>
                            </li>
                            <li>
                                <label>规格宽：</label>
                                <input type="text" name="guiGeKuan"/>
                            </li>
                            <li>
                                <label>规格高：</label>
                                <input type="text" name="guiGeGao"/>
                            </li>
                            <li>
                                <label>开向：</label>
                                <input type="text" name="kaiXiang"/>
                            </li>
                            <li>
                                <label>商品单价：</label>
                                <input type="text" name="danJia"/>
                            </li>
                            <li>
                                <label>备注：</label>
                                <input type="text" name="beizhu"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="tuihuo:tuihuoTest:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="tuihuo:tuihuoTest:edit">
                    <i class="fa fa-edit"></i> 单个勾选修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="tuihuo:tuihuoTest:remove">
                    <i class="fa fa-remove"></i> 勾选删除
                </a>
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="tuihuo:tuihuoTest:export">-->
<!--                    <i class="fa fa-download"></i> 导出全部-->
<!--                </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('tuihuo:tuihuoTest:edit')}]];
        var removeFlag = [[${@permission.hasPermi('tuihuo:tuihuoTest:remove')}]];
        var paymentMethodDatas = [[${@dict.getType('sys_pay')}]];
        var prefix = ctx + "tuihuo/tuihuoTest";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "购货退货",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'id',
                        title: '编号',
                        visible: false
                    },
                    {
                        field: 'tuihuoDanhao',
                        title: '退货单号'
                    },
                    {
                        field: 'chukuDate',
                        title: '退货日期'
                    },
                    {
                        field: 'shangpinName',
                        title: '商品名称'
                    },
                    {
                        field: 'tupian',
                        title: '商品图片',
                        formatter: function (value, row, index) {
                            var actions = [];
                            actions.push('<img src="' + value + '" style="width: 150px;height: 150px;object-fit: contain"> ');
                            return actions.join('');
                            console.log(value)
                        }
                    },
                    {
                        field: 'shangpinLeibie',
                        title: '商品类别'
                    },
                    {
                        field: 'guiGeKuan',
                        title: '规格宽'
                    },
                    {
                        field: 'guiGeGao',
                        title: '规格高'
                    },
                    {
                        field: 'kaiXiang',
                        title: '开向'
                    },
                    {
                        field: 'shuLiang',
                        title: '商品数量'
                    },
                    {
                        field: 'danJia',
                        title: '商品单价'
                    },
                    {
                        field: 'zongjine',
                        title: '总金额'
                    },
                    {
                        field: 'beizhu',
                        title: '备注'
                    },
                    {
                        field: 'chukuMen',
                        title: '退货操作人'
                    },
                /*{
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }*/
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>